
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>redis21 Redis主动复制 · Redis</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="<yangxin19970404@163.com>">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="redis21 Redis哨兵模式.html" />
    
    
    <link rel="prev" href="redis20 Redis发布订阅.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="redis01 redis开始.html">
            
                <a href="redis01 redis开始.html">
            
                    
                    redis01 redis开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="redis02 redis安装.html">
            
                <a href="redis02 redis安装.html">
            
                    
                    redis02 redis安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="redis03 redis基础知识.html">
            
                <a href="redis03 redis基础知识.html">
            
                    
                    redis03 redis基础知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="redis04 String数据类型详解.html">
            
                <a href="redis04 String数据类型详解.html">
            
                    
                    redis04 String数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="redis05 List数据类型详解.html">
            
                <a href="redis05 List数据类型详解.html">
            
                    
                    redis05 List数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="redis06 Set数据类型详解.html">
            
                <a href="redis06 Set数据类型详解.html">
            
                    
                    redis06 Set数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="redis07 Hash数据类型详解.html">
            
                <a href="redis07 Hash数据类型详解.html">
            
                    
                    redis07 Hash数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="redis08 Zset数据类型详解.html">
            
                <a href="redis08 Zset数据类型详解.html">
            
                    
                    redis08 Zset数据类型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="redis09 Geospatial地理位置详解.html">
            
                <a href="redis09 Geospatial地理位置详解.html">
            
                    
                    redis09 Geospatial地理位置详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="redis10 Hyperloglog基数统计详解.html">
            
                <a href="redis10 Hyperloglog基数统计详解.html">
            
                    
                    redis10 Hyperloglog基数统计详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="redis11 Bitmap位图场景详解.html">
            
                <a href="redis11 Bitmap位图场景详解.html">
            
                    
                    redis11 Bitmap位图场景详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="redis12 Redis事务操作.html">
            
                <a href="redis12 Redis事务操作.html">
            
                    
                    redis12 Redis事务操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="redis13 Redis实现乐观锁.html">
            
                <a href="redis13 Redis实现乐观锁.html">
            
                    
                    redis13 Redis实现乐观锁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="redis14 Jedis.html">
            
                <a href="redis14 Jedis.html">
            
                    
                    redis14 Jedis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="redis15 springBoot整合redis.html">
            
                <a href="redis15 springBoot整合redis.html">
            
                    
                    redis15 springBoot整合redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="redis16 RedisUtil.html">
            
                <a href="redis16 RedisUtil.html">
            
                    
                    redis16 RedisUtil
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="redis17 Redis.config详解.html">
            
                <a href="redis17 Redis.config详解.html">
            
                    
                    redis17 Redis.config详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="redis18 Redis持久化RDB.html">
            
                <a href="redis18 Redis持久化RDB.html">
            
                    
                    redis18 Redis持久化RDB
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="redis19 Redis持久化AOF.html">
            
                <a href="redis19 Redis持久化AOF.html">
            
                    
                    redis19 Redis持久化AOF
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="redis20 Redis发布订阅.html">
            
                <a href="redis20 Redis发布订阅.html">
            
                    
                    redis20 Redis发布订阅
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.22" data-path="redis21 Redis主动复制.html">
            
                <a href="redis21 Redis主动复制.html">
            
                    
                    redis21 Redis主动复制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.23" data-path="redis21 Redis哨兵模式.html">
            
                <a href="redis21 Redis哨兵模式.html">
            
                    
                    redis21 Redis哨兵模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.24" data-path="redis22 Redis缓存穿透和雪崩.html">
            
                <a href="redis22 Redis缓存穿透和雪崩.html">
            
                    
                    redis22 Redis缓存穿透和雪崩
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >redis21 Redis主动复制</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="redis&#x4E3B;&#x4ECE;&#x590D;&#x5236;">Redis&#x4E3B;&#x4ECE;&#x590D;&#x5236;</h3>
<p><strong>&#x6982;&#x5FF5;:</strong></p>
<p>&#x4E3B;&#x4ECE;&#x590D;&#x5236;,&#x662F;&#x6307;&#x5C06;&#x4E00;&#x53F0;Redis&#x670D;&#x52A1;&#x5668;&#x7684;&#x6570;&#x636E;,&#x590D;&#x5236;&#x5230;&#x5176;&#x4ED6;&#x7684;Redis&#x670D;&#x52A1;&#x5668;.&#x524D;&#x8005;&#x79F0;&#x4E3A;&#x4E3B;&#x8282;&#x70B9;(master/leader),&#x540E;&#x8005;&#x79F0;&#x4E3A;&#x4ECE;&#x8282;&#x70B9;(slave/follower);&#x6570;&#x636E;&#x7684;&#x590D;&#x5236;&#x662F;&#x5355;&#x5411;&#x7684;,&#x53EA;&#x6709;&#x7531;&#x4E3B;&#x8282;&#x70B9;&#x5230;&#x4ECE;&#x8282;&#x70B9;.Master&#x4EE5;&#x5199;&#x4E3A;&#x4E3B;,Slave&#x4EE5;&#x8BFB;&#x4E3A;&#x4E3B;.
&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;,&#x6BCF;&#x53F0;Redis&#x670D;&#x52A1;&#x5668;&#x90FD;&#x662F;&#x4E3B;&#x8282;&#x70B9;,&#x4E14;&#x4E00;&#x4E2A;&#x4E3B;&#x8282;&#x70B9;&#x53EF;&#x4EE5;&#x6709;&#x591A;&#x4E2A;&#x4ECE;&#x8282;&#x70B9;,&#x4F46;&#x662F;&#x4E00;&#x4E2A;&#x4ECE;&#x8282;&#x70B9;&#x53EA;&#x80FD;&#x6709;&#x4E00;&#x4E2A;&#x4E3B;&#x8282;&#x70B9;.</p>
<p><strong>&#x4E3B;&#x4ECE;&#x590D;&#x5236;&#x7684;&#x4F5C;&#x7528;&#x4E3B;&#x8981;&#x5305;&#x62EC;:</strong></p>
<ul>
<li>&#x6570;&#x636E;&#x5197;&#x4F59;: &#x4E3B;&#x4ECE;&#x590D;&#x5236;&#x5B9E;&#x73B0;&#x4E86;&#x6570;&#x636E;&#x7684;&#x70ED;&#x5907;&#x4EFD;,&#x662F;&#x6301;&#x4E45;&#x5316;&#x4E4B;&#x5916;&#x7684;&#x4E00;&#x79CD;&#x6570;&#x636E;&#x5197;&#x4F59;&#x65B9;&#x5F0F;.</li>
<li>&#x6545;&#x969C;&#x6062;&#x590D;: &#x5F53;&#x4E3B;&#x8282;&#x70B9;&#x51FA;&#x73B0;&#x95EE;&#x9898;&#x65F6;,&#x53EF;&#x4EE5;&#x7531;&#x4ECE;&#x8282;&#x70B9;&#x63D0;&#x4F9B;&#x670D;&#x52A1;,&#x5B9E;&#x73B0;&#x5FEB;&#x901F;&#x7684;&#x9F13;&#x638C;&#x6062;&#x590D;,&#x5B9E;&#x9645;&#x4E0A;&#x662F;&#x4E00;&#x79CD;&#x670D;&#x52A1;&#x7684;&#x5197;&#x4F59;</li>
<li>&#x8D1F;&#x8F7D;&#x5747;&#x8861;: &#x5728;&#x4E3B;&#x4ECE;&#x590D;&#x5236;&#x7684;&#x57FA;&#x7840;&#x4E0A;,&#x914D;&#x5408;&#x8BFB;&#x5199;&#x5206;&#x79BB;,&#x53EF;&#x4EE5;&#x7531;&#x4E3B;&#x8282;&#x70B9;&#x63D0;&#x4F9B;&#x5199;&#x670D;&#x52A1;,&#x7531;&#x4ECE;&#x8282;&#x70B9;&#x63D0;&#x4F9B;&#x8BFB;&#x670D;&#x52A1;,&#x5206;&#x62C5;&#x670D;&#x52A1;&#x5668;&#x8D1F;&#x8F7D;;&#x5C24;&#x5176;&#x662F;&#x5728;&#x5199;&#x5C11;&#x8BFB;&#x591A;&#x7684;&#x573A;&#x666F;&#x4E0B;,&#x901A;&#x8FC7;&#x591A;&#x4E2A;&#x4ECE;&#x8282;&#x70B9;&#x5206;&#x62C5;&#x8BFB;&#x8D1F;&#x8F7D;,&#x53EF;&#x4EE5;&#x5927;&#x5927;&#x7684;&#x63D0;&#x9AD8;&#x4E86;Redis&#x670D;&#x52A1;&#x5668;&#x7684;&#x5E76;&#x53D1;&#x91CF;</li>
<li>&#x9AD8;&#x53EF;&#x7528;&#x57FA;&#x77F3;: &#x9664;&#x4E86;&#x4E0A;&#x8FF0;&#x4F5C;&#x7528;&#x5916;,&#x4E3B;&#x4ECE;&#x590D;&#x5236;&#x8FD8;&#x662F;&#x54E8;&#x5175;&#x548C;&#x96C6;&#x7FA4;&#x80FD;&#x591F;&#x5B9E;&#x65BD;&#x7684;&#x57FA;&#x7840;,&#x56E0;&#x6B64;&#x8BF4;&#x4E3B;&#x4ECE;&#x590D;&#x5236;&#x662F;Redis&#x9AD8;&#x53EF;&#x7528;&#x7684;&#x57FA;&#x7840;.</li>
</ul>
<p>&#x4E00;&#x822C;&#x6765;&#x8BF4;,&#x8981;&#x5C06;Redis&#x8FD0;&#x7528;&#x5230;&#x5DE5;&#x7A0B;&#x9879;&#x76EE;&#x6C47;&#x603B;,&#x53EA;&#x4F7F;&#x7528;&#x4E00;&#x53F0;redis&#x662F;&#x4E07;&#x4E07;&#x4E0D;&#x80FD;&#x591F;&#x7684;,&#x539F;&#x56E0;&#x5982;&#x4E0B;:</p>
<ol>
<li>&#x4ECE;&#x7ED3;&#x6784;&#x4E0A;,&#x5355;&#x4E2A;redis&#x670D;&#x52A1;&#x5668;&#x4F1A;&#x53D1;&#x751F;&#x5355;&#x70B9;&#x6545;&#x969C;,&#x5E76;&#x4E14;&#x4E00;&#x53F0;&#x670D;&#x52A1;&#x5668;&#x9700;&#x8981;&#x5904;&#x7406;&#x6240;&#x6709;&#x7684;&#x8BF7;&#x6C42;&#x8D1F;&#x8F7D;,&#x538B;&#x529B;&#x8F83;&#x5927;</li>
<li>&#x4ECE;&#x5BB9;&#x91CF;&#x4E0A;,&#x5355;&#x4E2A;redis&#x670D;&#x52A1;&#x5668;&#x5185;&#x5B58;&#x5BB9;&#x91CF;&#x6709;&#x9650;,&#x5C31;&#x7B97;&#x4E00;&#x53F0;redis&#x670D;&#x52A1;&#x5668;&#x5185;&#x5B58;&#x5BB9;&#x91CF;&#x4E3A;256G.&#x4E5F;&#x4E0D;&#x80FD;&#x5C06;&#x6240;&#x6709;&#x5185;&#x5B58;&#x4F5C;&#x7528;&#x4E8E;Redis&#x5185;&#x5B58;&#x5B58;&#x50A8;.
<strong>&#x5355;&#x53F0;Redis&#x6700;&#x5927;&#x4F7F;&#x7528;&#x5185;&#x5B58;&#x4E0D;&#x5E94;&#x8BE5;&#x8D85;&#x8FC7;20G</strong></li>
</ol>
<p><img src="./imgs/&#x5FAE;&#x4FE1;&#x622A;&#x56FE;_20210320193615.png" alt=""></p>
<p>&#x4E3B;&#x4ECE;&#x590D;&#x5236;,&#x8BFB;&#x5199;&#x5206;&#x79BB;! 80%&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x90FD;&#x662F;&#x5728;&#x8FDB;&#x884C;&#x8BFB;&#x64CD;&#x4F5C;,&#x51CF;&#x7F13;&#x670D;&#x52A1;&#x5668;&#x7684;&#x538B;&#x529B;.&#x67B6;&#x6784;&#x4E2D;&#x7ECF;&#x5E38;&#x4F7F;&#x7528;&#x4E00;&#x4E3B;&#x4E24;&#x4ECE;
&#x56E0;&#x4E3A;&#x5DE5;&#x4F5C;&#x4E2D;&#x4E0D;&#x53EF;&#x80FD;&#x4F7F;&#x7528;&#x5355;&#x53F0;Redis&#x670D;&#x52A1;&#x5668;,&#x6240;&#x6709;&#x4E00;&#x5B9A;&#x4F1A;&#x6709;&#x4E3B;&#x4ECE;&#x590D;&#x5236;</p>
<h4 id="&#x914D;&#x7F6E;&#x73AF;&#x5883;">&#x914D;&#x7F6E;&#x73AF;&#x5883;</h4>
<p><strong>&#x53EA;&#x914D;&#x4ECE;&#x5E93;,&#x4E0D;&#x7528;&#x914D;&#x4E3B;&#x5E93;</strong></p>
<pre><code class="lang-shell">127.0.0.1:6379&gt; info replication  # &#x67E5;&#x770B;&#x5F53;&#x524D;&#x5E93;&#x7684;&#x4FE1;&#x606F;
# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:b9db3f130db64f70462ef9e0e3f0ccbb4380aa96
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
127.0.0.1:6379&gt;
</code></pre>
<ul>
<li>&#x590D;&#x5236;3&#x4E2A;&#x914D;&#x7F6E;&#x6587;&#x4EF6;,&#x7136;&#x540E;&#x4FEE;&#x6539;&#x5BF9;&#x5E94;&#x7684;&#x4FE1;&#x606F;<ol>
<li>&#x7AEF;&#x53E3;</li>
<li>pid&#x540D;&#x5B57;</li>
<li>log&#x6587;&#x4EF6;&#x540D;&#x5B57;</li>
<li>dump.rdb&#x540D;&#x5B57;</li>
</ol>
</li>
</ul>
<p><strong>&#x4FEE;&#x6539;&#x5B8C;&#x6BD5;&#x4E4B;&#x540E;&#x542F;&#x52A8;3&#x4E2A;redis&#x670D;&#x52A1;&#x5668;</strong></p>
<pre><code class="lang-shell">[root@izijy66dzll7bdz bin]# ps -ef|grep redis
root      8063     1  0 20:00 ?        00:00:00 redis-server 127.0.0.1:6379
root      9554     1  0 20:01 ?        00:00:00 redis-server 127.0.0.1:6380
root     10165     1  0 20:01 ?        00:00:00 redis-server 127.0.0.1:6381
root     10755 30551  0 20:01 pts/6    00:00:00 grep --color=auto redis
[root@izijy66dzll7bdz bin]#
</code></pre>
<h4 id="&#x4E00;&#x4E3B;&#x4E8C;&#x4ECE;">&#x4E00;&#x4E3B;&#x4E8C;&#x4ECE;</h4>
<p><strong>&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;,&#x6BCF;&#x53F0;Redis&#x90FD;&#x662F;&#x4E3B;&#x673A;,&#x6211;&#x4EEC;&#x53EA;&#x9700;&#x8981;&#x914D;&#x7F6E;&#x4ECE;&#x673A;&#x5373;&#x53EF;</strong></p>
<pre><code class="lang-shell">[root@izijy66dzll7bdz bin]# redis-cli -p 6380
127.0.0.1:6380&gt; slaveof 127.0.0.1 6379  # &#x627E;&#x8C01;&#x5F53;&#x81EA;&#x5DF1;&#x4E3B;&#x673A;
OK
127.0.0.1:6380&gt; info replication
# Replication
role:slave  # &#x5F53;&#x524D;&#x89D2;&#x8272;
master_host:127.0.0.1  #&#x4E3B;&#x673A;&#x4FE1;&#x606F;
master_port:6379
master_link_status:up
master_last_io_seconds_ago:1
master_sync_in_progress:0
slave_repl_offset:28
slave_priority:100
slave_read_only:1
connected_slaves:0
master_failover_state:no-failover
master_replid:188a8b8a9a7e47fab54dbd96c17b0322a317ec92
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:28
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:28
127.0.0.1:6380&gt; 

# &#x5728;&#x4E3B;&#x673A;&#x4E2D;&#x67E5;&#x770B;
[root@izijy66dzll7bdz bin]# redis-cli -p 6379
127.0.0.1:6379&gt; info replication
# Replication
role:master
connected_slaves:1
slave0:ip=127.0.0.1,port=6380,state=online,offset=182,lag=1
master_failover_state:no-failover
master_replid:188a8b8a9a7e47fab54dbd96c17b0322a317ec92
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:182
second_repl_offset:-1
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1
repl_backlog_histlen:182
127.0.0.1:6379&gt;
</code></pre>
<p><img src="./imgs/&#x5FAE;&#x4FE1;&#x622A;&#x56FE;_20210320201315.png" alt="">
&#x771F;&#x5B9E;&#x7684;&#x4E3B;&#x4ECE;&#x590D;&#x5236;&#x5E94;&#x8BE5;&#x5728;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;,&#x8FD9;&#x6837;&#x7684;&#x8BDD;&#x5C31;&#x662F;&#x6C38;&#x4E45;&#x7684;,&#x547D;&#x4EE4;&#x53EA;&#x662F;&#x6682;&#x65F6;&#x7684;</p>
<blockquote>
<p>&#x7EC6;&#x8282;</p>
</blockquote>
<p><strong>&#x4E3B;&#x673A;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x503C;,&#x4ECE;&#x673A;&#x4E0D;&#x80FD;&#x5199;&#x53EA;&#x80FD;&#x8BFB;,&#x4E3B;&#x673A;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x4FE1;&#x606F;&#x548C;&#x6570;&#x636E;,&#x90FD;&#x4F1A;&#x81EA;&#x52A8;&#x88AB;&#x4ECE;&#x673A;&#x4FDD;&#x5B58;</strong>
&#x4E3B;&#x673A;&#x5199;,&#x4ECE;&#x673A;&#x53EA;&#x80FD;&#x8BFB;&#x53D6;&#x5185;&#x5BB9;,&#x4ECE;&#x673A;&#x8981;&#x662F;&#x5199;&#x5C31;&#x4F1A;&#x62A5;&#x9519;</p>
<p><strong>&#x6D4B;&#x8BD5;:</strong></p>
<ul>
<li>&#x4E3B;&#x673A;&#x65AD;&#x5F00;&#x8FDE;&#x63A5;,&#x4ECE;&#x673A;&#x4F9D;&#x65E7;&#x8FDE;&#x63A5;&#x5230;&#x4E3B;&#x673A;&#x7684;,&#x4F46;&#x662F;&#x6CA1;&#x6709;&#x5199;&#x64CD;&#x4F5C;,&#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x5982;&#x679C;&#x4E3B;&#x673A;&#x56DE;&#x6765;&#x4E86;,&#x4ECE;&#x673A;&#x4F9D;&#x65E7;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x4E3B;&#x673A;&#x5199;&#x7684;&#x4FE1;&#x606F;.</li>
<li>&#x5982;&#x679C;&#x662F;&#x547D;&#x4EE4;&#x884C;&#x914D;&#x7F6E;&#x7684;&#x4E3B;&#x4ECE;,&#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x91CD;&#x542F;&#x4E86;&#x4ECE;&#x673A;,&#x5C31;&#x4F1A;&#x53D8;&#x4E3A;&#x4E3B;&#x673A;,&#x62FF;&#x4E0D;&#x5230;&#x4E4B;&#x524D;&#x914D;&#x7F6E;&#x4E3B;&#x673A;&#x7684;&#x4FE1;&#x606F;! &#x4F46;&#x662F;&#x53EA;&#x8981;&#x53D8;&#x4E3A;&#x4ECE;&#x673A;,&#x5C31;&#x4F1A;&#x7ACB;&#x523B;&#x4ECE;&#x4E3B;&#x673A;&#x4E2D;&#x83B7;&#x53D6;&#x503C;.</li>
</ul>
<blockquote>
<p>&#x590D;&#x5236;&#x539F;&#x7406;</p>
</blockquote>
<ul>
<li>Slave&#x542F;&#x52A8;&#x6210;&#x529F;&#x8FDE;&#x63A5;&#x5230;master&#x4F1A;&#x53D1;&#x9001;&#x4E00;&#x4E2A;sync&#x540C;&#x6B65;&#x547D;&#x4EE4;</li>
<li>Master&#x63A5;&#x5230;&#x547D;&#x4EE4;,&#x542F;&#x52A8;&#x540E;&#x53F0;&#x7684;&#x5B58;&#x76D8;&#x8FDB;&#x7A0B;,&#x540C;&#x65F6;&#x6536;&#x96C6;&#x6240;&#x6709;&#x7528;&#x4E8E;&#x4FEE;&#x6539;&#x6570;&#x636E;&#x96C6;&#x547D;&#x4EE4;,&#x5728;&#x540E;&#x53F0;&#x8FDB;&#x7A0B;&#x6267;&#x884C;&#x5B8C;&#x6BD5;&#x4E4B;&#x540E;,master&#x5C06;&#x4F20;&#x9001;&#x6574;&#x4E2A;&#x6570;&#x636E;&#x6587;&#x4EF6;&#x5230;slave,&#x5E76;&#x5B8C;&#x6210;&#x4E00;&#x6B21;&#x540C;&#x6B65;</li>
<li><strong>&#x5168;&#x91CF;&#x590D;&#x5236;: &#x800C;slave&#x670D;&#x52A1;&#x5728;&#x63A5;&#x6536;&#x5230;&#x6570;&#x636E;&#x5E93;&#x6587;&#x4EF6;&#x6570;&#x636E;&#x540E;,&#x5C06;&#x5176;&#x5B58;&#x76D8;&#x5E76;&#x52A0;&#x8F7D;&#x5230;&#x5185;&#x5B58;&#x4E2D;,</strong></li>
<li>&#x589E;&#x91CF;&#x590D;&#x5236;: Master&#x7EE7;&#x7EED;&#x5C06;&#x65B0;&#x7684;&#x6240;&#x6709;&#x6536;&#x96C6;&#x5230;&#x7684;&#x4FEE;&#x6539;&#x547D;&#x4EE4;&#x4F9D;&#x6B21;&#x4F20;&#x7ED9;slave,&#x5B8C;&#x6210;&#x540C;&#x6B65;.</li>
<li>&#x4F46;&#x662F;&#x53EA;&#x8981;&#x662F;&#x91CD;&#x65B0;&#x8FDE;&#x63A5;master,&#x4E00;&#x6B21;&#x5B8C;&#x5168;&#x540C;&#x6B65;(&#x5168;&#x91CF;&#x590D;&#x5236;)&#x5C06;&#x88AB;&#x81EA;&#x52A8;&#x6267;&#x884C;.</li>
</ul>
<p><img src="./imgs/&#x5FAE;&#x4FE1;&#x622A;&#x56FE;_20210320210414.png" alt="">  &#x624B;&#x52A8;&#x7684;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="redis20 Redis发布订阅.html" class="navigation navigation-prev " aria-label="Previous page: redis20 Redis发布订阅">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="redis21 Redis哨兵模式.html" class="navigation navigation-next " aria-label="Next page: redis21 Redis哨兵模式">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"redis21 Redis主动复制","level":"1.22","depth":1,"next":{"title":"redis21 Redis哨兵模式","level":"1.23","depth":1,"path":"redis21 Redis哨兵模式.md","ref":"redis21 Redis哨兵模式.md","articles":[]},"previous":{"title":"redis20 Redis发布订阅","level":"1.21","depth":1,"path":"redis20 Redis发布订阅.md","ref":"redis20 Redis发布订阅.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"<yangxin19970404@163.com>","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Redis","language":"zh-hans","gitbook":"3.2.3","description":"Redis > 缓存技术"},"file":{"path":"redis21 Redis主动复制.md","mtime":"2021-04-17T07:00:09.689Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-04-17T07:48:08.480Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

